package com.eight.travel.dao;

import com.eight.travel.pojo.HotelOrder;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface OrderMapper {

    //查看用户酒店订单
    @Select("select  u.uid, u.username,hc.hroominfoid, h.hotelname, hr.hotelroomnumber, hr.roomtype\n" +
            "from user u,hotel h, hotelroom hr,hotelcheckin hc\n" +
            "where h.hid=hr.hid and hr.hrid=hc.hrid and hc.uid = u.uid and hc.status=1 and u.uid=#{uid}")
    List<HotelOrder> selectHByUid(Integer uid);

    //退订酒店
    @Update("UPDATE hotelcheckin hc SET hc.status=0 where hroominfoid=#{hroominfoid}")
    int updateHotelOrder(Integer hroominfoid);
}
